import request from '@/utils/request'
var group_name = 'carousel'
export default {
  save(type) { // 添加
    return request({
      url: `/${group_name}/save`,
      method: 'post',
      data: type
    })
  },
  listBack() { // 后台查询
    return request({
      url: `/${group_name}/getAll`,
      method: 'get'
    })
  },
  getList() { // 前台查询
    return request({
      url: `/${group_name}/getAll`,
      method: 'get'
    })
  },
  update(type) { // 更新
    return request({
      url: `/${group_name}/updateCarousel`,
      method: 'put',
      data: type
    })
  },
  enableById(id) { // 启用
    return request({
      url: `/${group_name}/enableById/${id}`,
      method: 'put'
    })
  },
  disableById(id) { // 弃用
    return request({
      url: `/${group_name}/disableById/${id}`,
      method: 'put'
    })
  },
  deleteById(id) { // 删除
    return request({
      url: `/${group_name}/deleteById/${id}`,
      method: 'delete'
    })
  },
  get(id) { // 根据id查询
    return request({
      url: `/${group_name}/getById/${id}`,
      method: 'get'
    })
  },
  getEnabledTags() {
    return request({
      url: `/${group_name}/getEnabledTags`,
      method: 'get'
    })
  },
  getAllBlogNameForRouter() {
    return request({
      url: `/${group_name}/getAllBlogNameForRouter`,
      method: 'get'
    })
  }
}
